<template>
    <yt-page title="统计分析" :leftData="leftData">
      <yt-cell 
        v-show="userRole !== 'enterprise'"
        font="iconfont icon-data c-green" 
        label="执法文书统计专题" 
        labelWidth="120px" 
        @click="goPage('/analysis/law-doc')"
        isLink 
        ripple/>
      <yt-cell 
        font="iconfont icon-law c-blue" 
        label="行政执法监察专题" 
        labelWidth="120px" 
        @click="goPage('/analysis/law-monitor')"
        isLink 
        ripple/>
      <yt-cell 
        font="iconfont icon-machine-2 c-orange" 
        label="特殊作业统计专题" 
        labelWidth="120px" 
        @click="goPage('/analysis/special-work')"
        isLink 
        ripple/>
      <yt-cell 
        font="iconfont icon-danger c-red" 
        label="隐患排查治理专题" 
        labelWidth="120px" 
        @click="goPage('/analysis/danger-check')"
        isLink 
        ripple/>
      <yt-cell 
        font="iconfont icon-anquanzhenggaioff c-gray" 
        label="企业风险管控专题" 
        labelWidth="120px" 
        @click="goPage('/analysis/security-risk')"
        isLink 
        ripple/>
      <yt-cell 
        font="iconfont icon-machine c-blue" 
        label="应急资源统计专题" 
        labelWidth="120px" 
        @click="goPage('/analysis/emergency')"
        isLink 
        ripple/>
      <yt-cell 
        font="iconfont icon-jingshigantanhao c-red" 
        label="重大危险源报警统计专题" 
        labelWidth="200px" 
        @click="goPage('/analysis/danger-source-check-topic')"
        isLink 
        ripple/>
    </yt-page>
</template>

<script>
import { JudgeRole } from '@/store'
export default {
  data() {
    return {
      leftData: [
        {
          font: 'iconfont icon-left',
          click: () => {
            this.$router.$back()
          }
        }
      ],
      userRole: ''
    }
  },
  activated () {
    JudgeRole()
      .enterprise(() => {
        // 企业端登陆没有行政执法模块
        this.userRole = 'enterprise'
      })
    console.log(this.userRole)
  },
  methods: {
    goPage (path) {
      this.$router.$push(path)
    }
  }
}
</script>
